#include <iostream>

using namespace std;

int main()
{
    string a;
    cout<<"Introdu cuvantul: ";
    getline(cin,a);
    cout<<a<<endl;
    int j=0;//va fi jumatatea
    int n=a.size()-1;//lungimea lui a
    if (n%2==0) {j=n/2-1;} else {j=n/2;}//determin jumatatea
    int k=0;
    for (int i=0;i<=j;i++)
    {
        if (a[i]!=a[n-i]) {k++;}
    }
    if (k==0) {cout<<"E palindrom"<<endl;}
    else {cout<<"NU e palindrom"<<endl;}
    //optimizat
    int i=0;
    while ((a[i]==a[n-i])&&(i<=j))
        i++;
    if (i<j) {cout<<"NU E palindrom"<<endl;}
    else {cout<<"E palindrom"<<endl;}
    return 0;
}
